//
//  TPNavigationController.swift
//  TradingPlatform
//
//  Created by tam on 2017/8/8.
//  Copyright © 2017年 Wilkinson. All rights reserved.
//

import UIKit
import SnapKit

//导航栏的颜色
public let navigationColor:UIColor = R_UIThemeColor

class TPNavigationController: UINavigationController,UIGestureRecognizerDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
//        self.navigationBar.setBackgroundImage(UIImage.creatImageWithColor(color: navigationColor, size: CGSize(width:SCREEN_WIDTH,height:60), alpha: 1), for: .default)
        
        //导航栏
        self.navigationBar.titleTextAttributes = [
            NSFontAttributeName : UIFont.systemFont(ofSize: 18),
            NSForegroundColorAttributeName : UIColor.white
        ]
        self.navigationBar.setBackgroundImage(UIImage.init(), for: .default)
        self.navigationBar.shadowImage = UIImage.init()
        self.interactivePopGestureRecognizer?.isEnabled = false
        self.automaticallyAdjustsScrollViewInsets = false
        
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        /*
        if self.viewControllers.count != 0 {
            let backItem = UIBarButtonItem.init(image: UIImage.init(named: "back_gray"), style: .done, target: self, action: #selector(TPNavigationController.back))
            viewController.navigationItem.backBarButtonItem = backItem
        }
        */
        super.pushViewController(viewController, animated: true)
    }
    
    func back() {
        self.popViewController(animated: true)
    }
}


